<script lang="ts" setup>
import { defineAsyncComponent } from 'vue';

const props = defineProps<{ name: string }>();

const icon = defineAsyncComponent(() => import(`../assets/icons/${props.name}.svg`));
</script>

<template>
  <el-icon class="svg-icon">
    <component :is="icon" />
  </el-icon>
</template>

<style lang="scss" scoped>
.svg-icon {
  width: 1em;
  height: 1em;
  fill: currentColor;
  overflow: hidden;
}
</style>
